<template>
  <el-button plain @click="open1">可自动关闭</el-button>
  <el-button plain @click="open2">不会自动关闭</el-button>
  <el-button plain @click="open3">左下角</el-button>
  <el-button plain @click="open4">偏移的消息</el-button>

</template>

<script>
  import {h} from 'vue'
  export default {
    methods: {
      open1(){
        this.$notify({
          title: '提示标题',
          message: h(
            'i',
            { style: 'color: teal'},
            '这是提示的内容!'
          )
        })
      },
      open2(){
        this.$notify({
          title: '提示',
          message: '这是一条不会自动关闭的消息',
          duration: 0,
        })
      },
      open3(){
        this.$notify({
          title: '自定义位置',
          message: '左下角弹出的消息',
          position: 'bottom-left'
        })
      },
      open4() {
        this.$notify({
          title: '偏移',
          message: '这是一条有偏移的消息',
          offset: 100
        })
      }
    }
  }

</script>